﻿using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
      

        Random random = new Random();
        List<int> numbers = Enumerable.Range(0, 100)
                                      .Select(_ => random.Next(0, 1001)) // 每个整数范围在 0-1000
                                      .ToList();

        //用LINQ从大到小排序
        var sortedNumbers = numbers.OrderByDescending(num => num).ToList();

        int sum = sortedNumbers.Sum();
        double average = sortedNumbers.Average();



        // 输出
        Console.WriteLine("原始数据：");
        Console.WriteLine(string.Join(", ", numbers));

        Console.WriteLine("从大到小排序：");
        Console.WriteLine(string.Join(", ", sortedNumbers));

        Console.WriteLine($"总和：{sum}");
        Console.WriteLine($"平均数：{average:F2}");
    }
}
